<!DOCTYPE html>
<html lang="en">
<head>
	<script >
		var path="${path}";
	</script>
    <meta charset="UTF-8">
    <title>淘惠帮</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${resources}/plugins/fontAwesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/plugins/swiper/3.3.1/swiper.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/common.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/city-wide.css" rel="stylesheet" type="text/css">
        <#include "setwxshare.ftl"/>
</head>
<body>
<div id="container">
    <!--头部-->
    <div class="commonHeader">同城圈
        <a href="javascript:history.go(-1);" class="fa fa-chevron-left back"></a>
    </div>

    <div id="wrapper">
        <div>
            <div class="discussion">
                <div class="userInfo">
                    <div class="userImg"><img src="${topicvo.headimgurl}" alt=""></div>
                    <div class="nickname">${topicvo.nickname}</div>
                    <!-- 
                    <div class="weixinName">微信号：Kerem Lee</div>
                     -->
                </div>
                <div class="detail">
                    <h3 class="title">${topicvo.name}</h3>
                    <div class="date">${topicvo.createTime}</div>
                    <!-- 
                    <p class="problem">问：生意参谋平台是什么？</p>
                     -->
                    <p class="answer">
                    	${topicvo.content}
                    <div class="imgs">
                    	<#list topicvo.topicPicList as item>
                    	<div class="img">
                            <img src="${item.picurl}" alt="">
                        </div>
                    	</#list>
                    </div>
                </div>
            </div>
            <div class="allEvaluation">
                <h3 class="title">全部评论</h3>
                <#if (topicvo.replyList?size)<=0>
                <div class="noneEvaluation">
                    <img src="${resources}/images/not_available.png" alt="">
                </div>
                <#else>
                <ul class="evaluationList">
                </ul>
                <div id="tip">上滑加载更多..</div>
                </#if>
            </div>
        </div>

    </div>

    <ul class="operate">
        <li class="evaluate" style="width:100%;">
            <i class="fa fa-commenting-o" aria-hidden="true"></i>评论
        </li>
        <!--
        <li class="like">
            <i class="fa fa-thumbs-o-up" aria-hidden="true"></i>点赞
        </li>
        -->
    </ul>
    </div>
</div>

<input type="hidden" id="topicid" value="${topicvo.id}">

<script src="${resources}/plugins/jquery/2.2.2/jquery.min.js"></script>
<script src="${resources}/js/common.js"></script>
<script src="${resources}/js/iscroll-probe.js"></script>
<script src="${resources}/js/city-wide.js"></script>
<script type="text/javascript">
    $(".evaluate").click(function(){
        common.alert({
            width: "90%",
            dialog:"true",
            content:"<textarea id='comment_con'  rows='8' placeholder='内容 2-700个字'></textarea>",
            okValue:"发表",
            cancelValue:"取消",
            ok: function(){
				
            	$.ajax({
		        		type:'post',
		        		url:'${path}/bbs/reply/create',
		        		data:{
		        			"topic.id": '${topicvo.id}',
	                        "content": $("#comment_con").val()
		        		},
		        		success:function (data) {
		        			if(data.code=="000"){
                        		common.alert({content:'评价成功'});
                        		var reply = data.result;
                        		var html ="";
                        		html +="<li class=\"evaluation\"  data-id='"+reply.id+"'>";
		     					html +="	<div class=\"img\"><img src='"+reply.headimgurl+"' ></div>";
		     					html +="	<div class=\"nickname\">"+reply.nickname+"</div>";
		     					html +="	<div class=\"date\">"+reply.createTime+"</div>";
		     					html +="<p class=\"content\">"+reply.content+"</p>";
		     					html +="</li>";
		     					$(".evaluationList").append(html);
                        	}
		        		}
				});	
				
            },
            cancel: function(){

            },
            mask: "true"

        })
    })
</script>
</body>
</html>